# This is a sample Python script.

# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import math

import cv2
import numpy as np
import point

path = '/Users/wanggh/Desktop/a.jpeg'
# path = '/Users/wanggh/Desktop/b.jpeg'
# path = '/Users/wanggh/Desktop/c.jpeg'
# path = '/Users/wanggh/Desktop/d.jpeg'
# path = '/Users/wanggh/Desktop/e.jpeg'
# path = '/Users/wanggh/Desktop/original.jpeg'
# path = '/Users/wanggh/Desktop/b.jpeg'
image = cv2.imread(path)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
srcWidth, srcHeight, channels = image.shape
print(srcWidth, srcHeight)
binary = cv2.medianBlur(gray, 7)
ret, binary = cv2.threshold(binary, 127, 255, cv2.THRESH_BINARY)
cv2.imshow("test", binary)
cv2.waitKey(0)
cv2.destroyAllWindows()
